From: shand@kneesaa.uk.xensource.com Date: Thu, 29 Jun 2006 14:02:38 +0000 (+0100) Subject: [LINUX] When ballooning out (returning memory to xen), don't try too hard X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15912^2~34 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=064f5d4c72128379820d3db21e192914d9b25c5c;p=xen.git [LINUX] When ballooning out (returning memory to xen), don't try too hard to allocate pages - this reduces the chance of the oom killer being invoked. Signed-off-by: Steven Hand --- diff --git a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c index dcddf01ad7..95117b92cc 100644 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c @@ -99,6 +99,11 @@ static void balloon_process(void *unused); static DECLARE_WORK(balloon_worker, balloon_process, NULL); static struct timer_list balloon_timer; +/* When ballooning out (allocating memory to return to Xen) we don't really + want the kernel to try too hard since that can trigger the oom killer. */ +#define GFP_BALLOON \ + (GFP_HIGHUSER | __GFP_NOWARN | __GFP_NORETRY | __GFP_NOMEMALLOC) + #define PAGE_TO_LIST(p) (&(p)->lru) #define LIST_TO_PAGE(l) list_entry((l), struct page, lru) #define UNLIST_PAGE(p) \ @@ -269,7 +274,7 @@ static int decrease_reservation(unsigned long nr_pages) nr_pages = ARRAY_SIZE(frame_list); for (i = 0; i < nr_pages; i++) { - if ((page = alloc_page(GFP_HIGHUSER)) == NULL) { + if ((page = alloc_page(GFP_BALLOON)) == NULL) { nr_pages = i; need_sleep = 1; break;